<html>
<head>
	<meta charset="utf-8" />
	<meta name="generator" content="R package animation 2.6">
	<title>Animations Using the R Language</title>
	<link rel="stylesheet" href="css/reset.css" />
	<link rel="stylesheet" href="css/styles.css" />
	<link rel="stylesheet" href="css/scianimator.css" />
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/github.min.css">

	<script src="js/jquery-1.4.4.min.js"></script>
	<script src="js/jquery.scianimator.min.js"></script>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js"></script>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/languages/r.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>

</head>
<body>

	<div class="scianimator"><div id="Rplot" style="display: inline-block;"></div></div>
	<div class="scianimator" style="width: 480px; text-align: left"><pre><code class="r">## Animations generated in R version 4.0.2 (2020-06-22)
##   using the package animation
library(animation)
library(viridis)
library(viridisLite)
library(GWmodel)
library(spatialreg)
library(spData)
library(Rcpp)
library(robustbase)
library(maptools)
library(Hmisc)
library(Formula)
library(lattice)
library(survey)
library(Matrix)
library(modelsummary)
library(MASS)
library(stargazer)
library(xtable)
library(flextable)
library(officer)
library(fixest)
library(magick)
library(broom)
library(ggforce)
library(gganimate)
library(gapminder)
library(lubridate)
library(ggalt)
library(ggcorrplot)
library(nycflights13)
library(readstata13)
library(readxl)
library(AER)
library(survival)
library(sandwich)
library(lmtest)
library(zoo)
library(car)
library(carData)
library(future.apply)
library(future)
library(microbenchmark)
library(gt)
library(maps)
library(plotly)
library(patchwork)
library(raster)
library(sp)
library(sf)
library(prism)
library(exactextractr)
library(forcats)
library(stringr)
library(dplyr)
library(purrr)
library(readr)
library(tidyr)
library(tibble)
library(ggplot2)
library(tidyverse)
library(RColorBrewer)
library(ggthemes)
library(extrafont)
library(tmap)
library(RefManageR)
library(tictoc)
library(DT)
library(data.table)
library(xaringanthemer)
library(xaringanExtra)
library(flair)
library(flipbookr)
library(xaringanBuilder)
library(here)
library(rmarkdown)
library(knitr)
for (j in 1:50) {
    data <- data.frame()
    for (i in 1:4) {
        N <- n.list[i]
        x <- rnorm(N, mean = theta, sd = 1)
        qn <- -0.5 * (sum(x^2)/N - 2 * mean(x) * theta.seq + 
            theta.seq^2)
        temp <- cbind.data.frame(qn = qn, theta = theta.seq, 
            qn0 = qn0, theta.max = theta.seq[which.max(qn)], 
            qn.vert = seq(y.lower, max(qn), length = theta.len), 
            group = paste("N=", n.list[i], paste = ""))
        data <- rbind(data, temp)
    }
    g.con <- ggplot(data = data, aes(x = theta, y = qn)) + 
        geom_line() + geom_line(data = data, aes(x = theta.max, 
        y = qn.vert), colour = "blue") + geom_line(data = data, 
        aes(x = theta, y = qn0), colour = "red") + geom_line(data = data.frame(x = theta.seq[1], 
        y = seq(y.lower, y.upper, length = 1000)), aes(x = x, 
        y = y)) + geom_line(data = data.frame(x = theta.seq, 
        y = y.lower), aes(x = x, y = y)) + facet_grid(group ~ 
        .) + xlab("theta") + ylab("Qn") + ylim(y.lower, y.upper) + 
        theme(legend.position = "none", axis.title = element_text(size = 16), 
            axis.title.y = element_text(vjust = 0.35), axis.title.x = element_text(vjust = 0.15), 
            axis.text = element_text(size = 12), strip.text.y = element_text(size = 12, 
              color = "blue", angle = 90), strip.text.x = element_text(size = 12, 
              color = "blue"))
    print(g.con)
}
## R version 4.0.2 (2020-06-22)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Other packages: animation 2.6, viridis 0.6.1, viridisLite 0.4.0, GWmodel 2.2-8, spatialreg 1.1-5, spData 0.3.5, Rcpp 1.0.7, robustbase 0.93-6, maptools 0.9-9, Hmisc 4.5-0, Formula 1.2-4, lattice 0.20-41, survey 4.0, Matrix 1.2-18, modelsummary 0.6.1, MASS 7.3-51.6, stargazer 5.2.2, xtable 1.8-4, flextable 0.6.10, officer 0.4.1, fixest 0.10.1, magick 2.7.3,
## broom 0.7.6, ggforce 0.3.2, gganimate 1.0.6, gapminder 0.3.0, lubridate 1.7.10, ggalt 0.4.0, ggcorrplot 0.1.3, nycflights13 1.0.1, readstata13 0.10.0, readxl 1.3.1, AER 1.2-9, survival 3.1-12, sandwich 2.5-1, lmtest 0.9-38, zoo 1.8-9, car 3.0-10, carData 3.0-4, future.apply 1.5.0, future 1.21.0, microbenchmark 1.4-7, gt 0.2.2, maps 3.3.0, plotly 4.9.2.1,
## patchwork 1.0.0, raster 3.4-13, sp 1.4-5, sf 1.0-2, prism 0.1.0, exactextractr 0.7.0, forcats 0.5.0, stringr 1.4.0, dplyr 1.0.6, purrr 0.3.4, readr 1.4.0, tidyr 1.1.3, tibble 3.1.6, ggplot2 3.3.5, tidyverse 1.3.0, RColorBrewer 1.1-2, ggthemes 4.2.0, extrafont 0.17, tmap 3.1, RefManageR 1.3.0, tictoc 1.0, DT 0.13, data.table 1.14.0, xaringanthemer 0.3.0,
## xaringanExtra 0.5.5, flair 0.0.2, flipbookr 0.1.0, xaringanBuilder 0.0.9, here 1.0.1, rmarkdown 2.11, knitr 1.37</code></pre></div>
	<script src="js/Rplot.js"></script>
<!-- highlight R code -->

</body>
</html>
